<?php
require_once("../control/Config_control.php");

if(isset($_POST['salvar'])){

$host=$_POST['host'];
$user=$_POST['user'];
$paswd=$_POST['paswd'];
$porta=$_POST['porta'];
$banco=$_POST['banco'];

$config=new Config_control;
$res=$config->gravar($host,$user,$paswd,$porta,$banco);
if($res){
	echo"<script>window.location='../view/'</script>";
}else{
	echo"<script>alert('Erro!!!!!');window.location='../control/config.php'</script>";
}

}else{
	echo"<script>alert('Erro!!!!!');window.location='../'</script>";
}


?>